package cc.lpz.backend.mapper;

import cc.lpz.backend.entity.Role;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface RoleMapper extends BaseMapper<Role> {
    @Select("select * from role where id in (select role_id from user_role where user_id=#{userId})")
    List<Role> selectByUserId(@Param("userId") int userId);
}
